<?php

class Adept_Renderer_RadioButton extends Adept_Renderer_Control 
{
    
    /**
     * @param Adept_Component_CheckBox $component
     */
    public function renderBegin($component) 
    {   
        $writer = $component->getWriter();
        
        if ($component->getLabel() != null)  {
            $writer->writeHtmlTag('label');    
        }
        
        $attributes = array(
            'id' => $component->getId(),
            'type' => 'radio',
            'class' => $component->getClass(),
            'style' => $component->getStyle(),
            'name' => $component->getGroup(),
            'checked' => $component->isChecked() ? 'true' : null,
            'value' => $component->getDisplayValue(),
            'accesskey' => $component->getAccessKey(),
            'alt' => $component->getAlt(),
            'disabled' => $component->isDisabled() ? 'true' : null,
            'tabindex' => $component->getTabIndex(),
        );        
        //$attributes = array_merge($attributes, $component->getBrowserEvents());

        
        $writer->writeHtmlTag('input', $attributes, true);
        
        if ($component->getLabel() != null) {
            $writer->write($component->getLabel());
            $writer->write('</label>' . "\n");
        }
    }        
    
}